<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="panel panel-default panel-intro">
        <div class="panel-heading">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#first" data-toggle="tab">{:__('ExamineAndVerify')}</a></li>
                <li><a href="#second" data-toggle="tab">{:__('ApplyGoods')}</a></li>
            </ul>
        </div>
        <div class="panel-body">
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade active in" id="first">

                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('State')}:</label>
                        <div class="col-xs-12 col-sm-8">

                            <div class="radio">
                                {foreach name="stateList" item="vo"}
                                <label for="row[state]-{$key}"><input id="row[state]-{$key}" name="row[state]" type="radio" value="{$key}" {in name="key" value="$row.state"}checked{/in} /> {$vo}</label>
                                {/foreach}
                            </div>

                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
                        <div class="col-xs-12 col-sm-8">
                            <input id="c-desc" data-rule="required" class="form-control" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
                        </div>
                    </div>

                </div>

                <div class="tab-pane fade" id="second">

                    <div class="form-group">
                        <div class="col-xs-12 col-sm-8">
                            <table id="table" class="table table-striped table-bordered table-hover table-nowrap" width="100%">
                                <thead>
                                <tr>
                                    <th style="text-align: center; vertical-align: middle; " data-field="goods_id">
                                        {:__('Batch Settings')}
                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="goods_name">

                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="pro_no">

                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="images">

                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="goods_price">

                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="line_price">

                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="cost_price">

                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="rate">
                                        <input id='blogger_rate' type="number" style="width: 80px;" placeholder="{:__('Blogger_rate')}">
                                        <button type="button" class="btn btn-sm btn-secondary radius" onclick="rateBatchBtn()">{:__('OK')}</button>
                                    </th>
                                </tr>
                                <tr>
                                    <th style="text-align: center; vertical-align: middle; " data-field="goods_id">
                                        <div class="th-inner ">{:__('GoodsId')}</div>
                                        <div class="fht-cell"></div>
                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="goods_name">
                                        <div class="th-inner ">{:__('Goods_name')}</div>
                                        <div class="fht-cell"></div>
                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="pro_no">
                                        <div class="th-inner ">{:__('Pro_no')}</div>
                                        <div class="fht-cell"></div>
                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="images">
                                        <div class="th-inner ">{:__('Image')}</div>
                                        <div class="fht-cell"></div>
                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="goods_price">
                                        <div class="th-inner ">{:__('Goods_price')}</div>
                                        <div class="fht-cell"></div>
                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="line_price">
                                        <div class="th-inner ">{:__('Line_price')}</div>
                                        <div class="fht-cell"></div>
                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="cost_price">
                                        <div class="th-inner ">{:__('Cost_price')}</div>
                                        <div class="fht-cell"></div>
                                    </th>
                                    <th style="text-align: center; vertical-align: middle; " data-field="rate">
                                        <div class="th-inner ">{:__('Blogger_rate')}</div>
                                        <div class="fht-cell"></div>
                                    </th>
                                </tr>
                                </thead>
                                <tbody data-listidx="0">

                                {foreach name="$row.goods_info" item="vo"}
                                <tr data-index={$key}>
                                    <td style="text-align: center; vertical-align: middle; ">{$vo.goods_id}</td>
                                    <td style="text-align: center; vertical-align: middle; ">{$vo.goods_name}</td>
                                    <td style="text-align: center; vertical-align: middle; ">{$vo.pro_no}</td>
                                    <td style="text-align: center; vertical-align: middle; "><img class="img-sm img-center" src="{$vo.images}"></td>
                                    <td style="text-align: center; vertical-align: middle; ">{$vo.goods_price}</td>
                                    <td style="text-align: center; vertical-align: middle; ">{$vo.line_price}</td>
                                    <td style="text-align: center; vertical-align: middle; ">{$vo.cost_price}</td>
                                    <td style="text-align: center; vertical-align: middle; "><input class="form-control blogger_rate" name="row[goods_info][{$vo.goods_id}]" type="number" value="" style="width: 80px;"></td>
                                </tr>
                                {/foreach}

                                </tbody>
                            </table>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script>
    function rateBatchBtn(){
        var blogger_rate= $("#blogger_rate").val();
        $(".blogger_rate").val(blogger_rate);
    }
</script>